﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script>
    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.0/js/dojo/dijit/themes/tundra/tundra.css" />
</head>
<body>
    <script type="text/javascript">
        dojo.require("esri.map");

        function onProjectComplete(graphics) {
            debugger;
            console.log(graphics);
        }

        function onError() {
            debugger;
            console.log("Error");
        }

        function doStuff() {
            console.log("dostuff");
            var geoservice = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
            var sourcewkid = new esri.SpatialReference({ "wkid": 2263 });
            var destwkid = new esri.SpatialReference({ "wkid": 4326 });
            var point = new esri.geometry.Point(975762, 171410, sourcewkid);
            console.log(sourcewkid, destwkid, point);
            debugger;
            try {
                geoservice.project([point], destwkid, onProjectComplete, onError);
            }
            catch (err) {
                console.log(err);
            }
            var infoTemplate = new esri.InfoTemplate("Test", "test: ${test}");
            var attr = { "test": "test" };
            var sms = new esri.symbol.SimpleMarkerSymbol().setStyle(
	                            esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE).setColor(
	                            new dojo.Color([255, 0, 0, 0.5]));
            var test = new esri.Graphic(point, sms, attr, infoTemplate);
            //map.graphics.add(test);
        }

        doStuff();
    </script>
</body>
</html>
